<?php
use pc\models\Tags;
$tags = Tags::randTags(20);
?>

<!--大家都在搜-->
<div class="r_box1 mt20">
    <h3><span><em>大家</em>都在搜</span></h3>
    <div class="key_list mt10">
        <?php
//            //标签版
//            foreach($tags as $tag){
//                $category = intval($tag['category']);
//                $categoryUrl = [1 => 'meinv' , 2 => 'xiezhen'];
//                $categoryTitle = [1 => '美女' , 2 => '美女写真'];
//                $category == 0 && $category =  rand(1,2);
//
//                if($category == 1 || $category == 2){
//                    $url = '/' . $categoryUrl[$category] . '/' . $tag['alias'] . '/';
//                    echo "<a href='{$url}' title = '{$tag['name']}{$categoryTitle[$category]}'>{$tag['name']}</a>";
//                }
//            }

//            //搜索版
            foreach($tags as $tag){
                echo "<a href='/search/?keyword={$tag['name']}'>{$tag['show_name']}</a>";
            }

        ?>
    </div>
</div>